import { Global, Module } from '@nestjs/common';
import { ConfigService } from './config.service';
import { ConfigModule as ConfigMd } from '@nestjs/config';
import configuration from './configs/index';

@Global()
@Module({
  imports: [
    ConfigMd.forRoot({
      isGlobal: true,
      load: [configuration], // 加载配置文件
    }),
  ],
  providers: [ConfigService],
  exports: [ConfigService],
})
export class ConfigModule {}
